package com.gxxd.model;
/*
 * 黄苗苗44
 */
public class Subject {
	private String subjectName;
	private String subjectNum;
	private int subjectTime;
	private Student[] studentArray;
	private int studentCount;
	public Student[] getStudentArray() {
		if(studentArray == null)
			this.studentArray = new Student[200];
		return studentArray;
	}
	public void setStudentArray(Student[] studentArray) {
	this.studentArray = studentArray;	
	}
	public Subject() {	
	}
	public Subject(String subjectName,String subjectNum,int subjectTime) {
		this.setSubjectName(subjectName);
		this.setSubjectNum(subjectNum);
		this.setSubjectTime(subjectTime);
	}
	public Subject(String subjectName,String subjectNum,int subjectTime,Student[] studentArray) {
		this.setSubjectName(subjectName);
		this.setSubjectNum(subjectNum);
		this.setSubjectTime(subjectTime);
		this.setStudentArray(studentArray);
	}	
	public String getSubjectName() {
		return subjectName;
	}
	public void setSubjectName(String subjectName) {
		this.subjectName = subjectName;
	}
	public String getSubjectNum() {
		return subjectNum;
	}
	public void setSubjectNum(String subjectNum) {
		this.subjectNum = subjectNum;
	}
	public int getSubjectTime() {
		return subjectTime;
	}
	public void setSubjectTime(int subjectTime) {
		if(subjectTime<=0)
			return;
		this.subjectTime = subjectTime;
	}
	public String printDetail() {
		String ref = "专业详细信息为：\nר专业名称："+this.getSubjectName()+"\n专业编号"
				+this.getSubjectNum()+"\n学时"+this.getSubjectTime();
		return ref;
	}
	public void addStudent(Student student) {
		for(int i = 0;i<this.getStudentArray().length;i++) {
			if(this.getStudentArray()[i]==null) {
				this.getStudentArray()[i] = student;
				this.studentCount = i+1;
				return;
			}
		}
	}
	public String getStudentcount() {
		// TODO Auto-generated method stub
		return null;
	}
}
